import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class MyAccount extends StatefulWidget {
  @override
  _MyAccountState createState() => _MyAccountState();
}

class _MyAccountState extends State<MyAccount> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          '我的账户',
          style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.bold),
        ),
        centerTitle: true,
      ),
      body: CustomScrollView(
        slivers: [
          SliverToBoxAdapter(
            child: Container(
              height: 400.w,
              margin: EdgeInsets.only(left:25.w,right: 25.w),
              padding: EdgeInsets.only(left: 25.w,right: 25.w),
              decoration: BoxDecoration(
                  color: Colors.red,
                  borderRadius: BorderRadius.all(Radius.circular(15))),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    '总资产(元)',
                    style: TextStyle(color: Colors.white),
                  ),
                  Text(
                    '0.00',
                    style: TextStyle(color: Colors.white,
                    fontSize: 50.sp),
                  ),
                  Text(
                    '累计消费(元)',
                    style: TextStyle(color: Colors.white),
                  ),
                  Text(
                    '0',
                    style: TextStyle(color: Colors.white),
                  )
                ],
              ),
            ),
          ),
          SliverToBoxAdapter(
            child: Container(
              margin: EdgeInsets.only(top: 35.w),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  Column(
                    children: [Icon(Icons.account_balance_wallet,color: Colors.red,size: 60.sp,), Text('账单记录',style: TextStyle(
                      color: Colors.grey
                    ),)],
                  ),
                  Column(
                    children: [Icon(Icons.alarm,color: Colors.red,size: 60.sp,), Text('消费记录',style: TextStyle(
                        color: Colors.grey
                    ),)],
                  ),
                  Column(
                    children: [Icon(Icons.star,color: Colors.red,size: 60.sp,), Text('积分中心',style: TextStyle(
                        color: Colors.grey
                    ),)],
                  ),
                ],
              ),
            ),
          ),
          SliverToBoxAdapter(
            child: Container(
              margin: EdgeInsets.only(top: 50.w),
              padding: EdgeInsets.only(left:25.w),
              alignment: Alignment.center,
              child: Row(
                children: [
                  Container(
                    decoration: BoxDecoration(
                        color: Colors.orange[100],
                      borderRadius: BorderRadius.all(Radius.circular(5))
                    ),
                    child: Row(
                      children: [
                        Container(
                            alignment: Alignment.center,
                            width:270.w,
                            height:150.w,
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Text('签到领积分',style: TextStyle(
                                    color: Colors.red,
                                    fontSize: 40.sp,
                                    fontWeight: FontWeight.bold
                                ),),
                                SizedBox(height: 20.w,),
                                Text('赚积分领现金',style: TextStyle(
                                    color: Colors.red
                                ),)
                              ],
                            )
                        )
                        ,Icon(Icons.alarm,color: Colors.red,size: 40,)
                      ],
                    ),
                  ),
                  SizedBox(width: 30.w,),
                  Container(
                    decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.all(Radius.circular(5))
                    ),
                    child: Row(
                      children: [
                        Container(
                            alignment: Alignment.center,
                            width:270.w,
                            height:150.w,
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Text('领取优惠券',style: TextStyle(
                                    color: Colors.red,
                                    fontSize: 40.sp,
                                    fontWeight: FontWeight.bold
                                ),),
                                SizedBox(height: 20.w,),
                                Text('满减享优惠',style: TextStyle(
                                    color: Colors.red
                                ),)
                              ],
                            )
                        )
                        ,Icon(Icons.alarm,color: Colors.red,size: 40,)
                      ],
                    ),
                  )

                ],
              ),
            )
          ),
          SliverToBoxAdapter(
            child: Column(
              children: [
                ListTile(
                  leading: Icon(Icons.alarm,size: 50,color: Colors.red,),
                  title: Text('最新拼团活动',
                    style: TextStyle(
                      fontWeight: FontWeight.bold,

                    ),),
                  subtitle: Text('最新优惠商品上架拼团',
                  style: TextStyle(
                    color: Colors.grey

                  ),),
                  trailing: OutlineButton(
                    shape:RoundedRectangleBorder(
                      borderRadius: BorderRadius.all(Radius.circular(30.w))
                    ),
                    onPressed: (){},
                    child: Text('立即参与'),
                  ),
                ),
                ListTile(
                  leading: Icon(Icons.alarm,size: 50,color: Colors.orange,),
                  title: Text('当前限时秒杀',
                    style: TextStyle(
                      fontWeight: FontWeight.bold,

                    ),),
                  subtitle: Text('最新商品秒杀进行中',
                    style: TextStyle(
                        color: Colors.grey

                    ),),
                  trailing: OutlineButton(
                    shape:RoundedRectangleBorder(
                        borderRadius: BorderRadius.all(Radius.circular(30.w))
                    ),
                    onPressed: (){},
                    child: Text('立即参与'),
                  ),
                ),
                ListTile(
                  leading: Icon(Icons.alarm,size: 50,color: Colors.green,),
                  title: Text('砍价活动',
                    style: TextStyle(
                      fontWeight: FontWeight.bold,

                    ),),
                  subtitle: Text('呼朋唤友来砍价',
                    style: TextStyle(
                        color: Colors.grey

                    ),),
                  trailing: OutlineButton(
                    shape:RoundedRectangleBorder(
                        borderRadius: BorderRadius.all(Radius.circular(30.w))
                    ),
                    onPressed: (){},
                    child: Text('立即参与'),
                  ),
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}
